<?php
session_start();

include ("../include/class.function.php");
$inancm = new inancm();

foreach($_REQUEST as $key => $value)  {
	$$key = $value;
	//echo $key ."=". $value."<br>";
}
error_reporting(E_ALL ^ E_NOTICE);
//pre($_SESSION);
?>




<?php
if (empty($_SESSION['pass_actived'])){
	?>
     <META HTTP-EQUIV="Refresh" CONTENT="0;URL=login.php">
	<?php
} else {
	$u_username = $_SESSION['u_username'] ; //username 
	$u_id = $_SESSION['u_id'];	 //id 
	$u_name = $_SESSION['u_name']; 
	
?>
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!--<meta name="viewport" content="width=device-width, initial-scale=1"> -->
    <title>iNanCM Admin</title>
    <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon">
    <link rel="icon" href="../favicon.ico" type="image/x-icon">
    <link rel="apple-touch-icon-precomposed" href="images/apple-touch-icon.png">
    <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300,300italic,400italic,600,600italic,700,700italic,800,800italic' rel='stylesheet' type='text/css'>
    
    <!-- Bootstrap core CSS -->
    <link rel="stylesheet" type="text/css" href="../bootstrap/dist/css/bootstrap.css">
    <link rel="stylesheet" type="text/css" href="../bootstrap/dist/css/bootstrap.min.css">
    <!-- Bootstrap theme -->
    <link rel="stylesheet" type="text/css" href="../bootstrap/dist/css/bootstrap-theme.css">
    <link rel="stylesheet" type="text/css" href="../bootstrap/dist/css/bootstrap-theme.min.css">

    <!-- Custom styles for this template -->
    <link href="css/theme.css" rel="stylesheet">
    
    <script src="../js/jquery-1.7.2.js"></script>
    <script src="../js/jquery-1.7.2.min.js"></script>
    <script src="../bootstrap/dist/js/bootstrap.js"></script>        
    <script src="../bootstrap/dist/js/bootstrap.min.js"></script> 
    
    <!--[if lt IE 8]>
        <link href="../css/bootstrap-ie7.css" rel="stylesheet">
    <![endif]-->
  
    <!-- Just for debugging purposes. Don't actually copy this line! -->
    <!--[if lt IE 9]><script src="../bootstrap/docs/assets/js/ie8-responsive-file-warning.js"></script><![endif]-->

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
      <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <style type="text/css">
        .debug_css {
            border:#F60 1px dotted;
        }
    </style>
   </head>

   <body>

	
     <div class="navbar navbar-default navbar-fixed-top" role="navigation">
      <div class="container">
        <div class="navbar-header">         
          <a class="navbar-brand" href="index.php">iNanCM</a>
        </div>
        <div class="collapse navbar-collapse">
            <ul class="nav navbar-nav">
                <li id="m-home" class="navmenu"><a href="?ap=home"><i class="glyphicon glyphicon-home"></i> Home</a></li>
                <li id="m-blog" class="navmenu"><a href="?ap=blog"><i class="glyphicon glyphicon-list-alt"></i> blog</a></li>              
            </ul>
             <ul class="nav navbar-nav navbar-right">
              <li class="active"><a href="logout.php">Logout</a></li>              
            </ul>
        </div><!--/.nav-collapse -->
      </div>
    </div>


	<script type="text/javascript">
        $(document).ready(function(){
            var ap = '<?php echo $ap;?>';
            $('.navmenu').removeClass('active');
            
            switch (ap){
                case 'home':
                case '':
                    $('#m-home').addClass('active');
                    break;
                case 'blog':
                    $('#m-blog').addClass('active');
                    break;
                default:
                    $('#m-home').addClass('active');
            }
        });
    </script>


    <div class="container">    
    <?php
    if (!isset($ap)) { $ap = 'home'; }
    switch ($ap){
        case 'home':
            include ('modules/mod_home/home.php');
            break;
        case 'blog':
            include ('modules/mod_blog/blog.php');
            break;
        default:
            include ('modules/mod_home/home.php');
    
    }
    ?>  
    
    <hr>
    <div class="well">Copyright 2014 All Rights Reserved. </div>

    </div> <!-- /container -->     

 </body>

</html>
<?php } ?>